﻿Imports System.Drawing
Imports System.Windows.Forms

Public Class frmDataManager

    Private Sub frmDataManager_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Armar_Grilla()
    End Sub

    Private Sub Armar_Grilla()
        Dim dtPortaf As New DataTable
        Dim dsPortaf As New DataSet

        Dim dr, dr2, dr3 As DataRow

        dtPortaf.Columns.Add("Moneda")
        dtPortaf.Columns.Add("Factor")
        dtPortaf.Columns.Add("Valor")

        dr = dtPortaf.NewRow
        dr2 = dtPortaf.NewRow
        dr3 = dtPortaf.NewRow

        dr(0) = "PEN"""
        dr(1) = "*"
        dr(2) = "3.50"

        dtPortaf.Rows.Add(dr)

        dr2(0) = "USD"
        dr2(1) = "*"
        dr2(2) = "1.0"

        dtPortaf.Rows.Add(dr2)

        dr3(0) = "EUR"
        dr3(1) = "/"
        dr3(2) = "3.40"

        dtPortaf.Rows.Add(dr3)
        dsPortaf.Tables.Add(dtPortaf)
        'dgDataManager.DataSource = dsPortaf.Tables(0)

    End Sub

    'Private Sub dgDataManager_CellMouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs)
    '    Dim Colum, Fila As Integer
    '    Dim grid As DataGridView = sender
    '    Dim pt As Point = grid.PointToClient(Control.MousePosition)

    '    If e.Button = Windows.Forms.MouseButtons.Right Then
    '        Colum = e.ColumnIndex
    '        Fila = e.RowIndex
    '        If Colum < 0 Or Fila < 0 Then
    '            Exit Sub
    '        End If

    '        With Me.dgDataManager
    '            Dim Hitest As DataGridView.HitTestInfo = .HitTest(e.X, e.Y)
    '            If Hitest.Type - 1 = DataGridViewHitTestType.Cell Then
    '                .CurrentCell = .Rows(Fila).Cells(Colum)
    '            End If
    '        End With

    '        If dgDataManager.AllowUserToAddRows = True Then

    '            If dgDataManager.Rows.Count > 1 Then

    '                Me.ContextMenuStrip1.Show(dgDataManager, pt.X, pt.Y)

    '            End If

    '        Else

    '            If dgDataManager.Rows.Count > 0 Then

    '                Me.ContextMenuStrip1.Show(dgDataManager, pt.X, pt.Y)

    '            End If

    '        End If

    '    End If
    'End Sub

    'Private Sub ExportarVolatilidadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExportarVolatilidadToolStripMenuItem.Click
    '    Cursor = Cursors.WaitCursor
    '    Exportar_Excel(dgDataManager)
    '    Cursor = Cursors.Default
    'End Sub
End Class